package net.knightwatch.kwtools.database; 

import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class AnswerTable {
	// Class Information
				private static final String TAG = "AnswersTable";
				// Database Table
				public static final String TABLE_ANSWERS = "Answers";
				public static final String COLUMN_ID = "_id";
				public static final String COLUMN_ITEM_ID = "itemId";
				public static final String COLUMN_QUESTION_ID = "questionId";
				public static final String COLUMN_ANSWER_TYPE = "answerTypeId";
				public static final String COLUMN_CUSTOMER_ID = "customerId";
				
				// Database Creation SQL Statement
				private static final String DATABASE_CREATE = "create table " 
						+ TABLE_ANSWERS
						+ "("
						+ COLUMN_ID + " integer primary key autoincrement, "
						+ COLUMN_CUSTOMER_ID + " integer not null,"
						+ COLUMN_QUESTION_ID + " integer not null,"
						+ COLUMN_ITEM_ID + " integer not null,"
						+ COLUMN_ANSWER_TYPE + " integer not null"
						+ ");";
				
				public static void onCreate(SQLiteDatabase database) {
					
					try {
						Log.i(TAG, DATABASE_CREATE);
						database.execSQL(DATABASE_CREATE);
					} catch (SQLException e) {
						Log.e(TAG, "Unable to create table.");
						e.printStackTrace();
					} finally {
						Log.i(TAG, "Table "+TABLE_ANSWERS+" has been created.");
					}
				}
				public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
					
				}
}
